package operation;

import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class AddOperation implements IOPeration {
    public void work(BookList bookList){
        System.out.println("新增图书");
        System.out.println("输入图书名字");
        Scanner sc = new Scanner(System.in);
        String name= sc.nextLine();
        System.out.println("输入作者");
        String author= sc.nextLine();
        System.out.println("输入类型");
        String type= sc.nextLine();
        System.out.println("输入作者价格");
        int price= sc.nextInt();

        Book book=new Book(name,author,price,type);
        int current=bookList.getUsedSize();
        bookList.setBooks(current,book);
        bookList.setUsedSize(current+1);
        System.out.println("新增成功");
            }
    }

